package com.sj.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.AbstractPersistable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.Set;

/**
 * Created by yangrd on 2018/3/8
 **/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_account")
public class Account extends AbstractPersistable<Long> {

    private String name;

    private String password;

    private Boolean enable;

    @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH})
    private Set<Authority> authorities;


}
